package com.idol.web.servlet.http;

import com.idol.web.bean.Request;
import com.idol.web.bean.Response;
import com.idol.web.servlet.Servlet;

/**
 * @author Supreme_Sir
 * @version 1.0
 * @className HttpServlet
 * @description 自定义 HttpServlet 供 web 工程继承
 * @date 2020/11/22 14:27
 **/
public abstract class HttpServlet implements Servlet {
    @Override
    public void service(Request request, Response response) {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    public abstract void doGet(Request request, Response response);

    public abstract void doPost(Request request, Response response);
}
